package pkg

import (
	"fmt"
	"github.com/Baidu-AIP/golang-sdk/aip/censor"
	"github.com/Baidu-AIP/golang-sdk/util"
)

func CheckImg(dsn string) {
	client := censor.NewClient("r3tHr6zl3zYaPlccddD8OUgq", "2cyQ75NhvCWyIbkyfVq21TpbVSLpcmu5")
	//图片文件，
	base64d := util.ReadFileToBase64("图片路径")
	res := client.ImgCensor(base64d, nil)
	fmt.Println(res)
	//图片url
	res = client.ImgCensorUrl("图片url", nil)
	fmt.Println(res)

}

func CheckText(message string) {
	client := censor.NewClient("r3tHr6zl3zYaPlccddD8OUgq", "2cyQ75NhvCWyIbkyfVq21TpbVSLpcmu5")
	res := client.TextCensor(message)

	fmt.Println(res)

}
